#ifndef HEADER_BT_KART_HPP
#define HEADER_BT_KART_HPP

#include "btBulletDynamicsCommon.h"

class byDynamicsWorld;
struct btWheelInfo;

class btKart : public btRaycastVehicle
{
	void defaultInit(const btVehicleTunning& tunning);
	btScalar m_track_connect_accel;
	btScalar m_skidding_factor;
	int m_num_wheels_on_ground;
	bool m_zipper_active;
	btScalar m_zipper_velocity;
	
public:
	btKart(const btVehicleTunning& tunning, btRigidBody* chassis,
			btVehcileRaycaster* raycaster, float track_connect_accel);
	virtual ~btKart();
	btScalar rayCast(btWheelInfo& wheel);
	btScalar rayCast(btWheelInfo& wheel, const btVector3& ray);
	bool projectVehicleToSurface(const btVector3& ray, bool translate_vehicle);
	void setSkidding(btScalar sf) {m_skidding_factor = sf;}
	virtual void updateVehicle(btScalar step);
	void resetSuspension();
	int getNumWheelsOnGround() const {return m_num_wheels_on_ground;}
	void setRaycastWheelInfo(int wheelIndex, bool isInContact,
							 const btVector3& hitPoint,
							 const btVector3& hitNormal, btScalar depth);
	void setPitchControl(btScalar pitch) {m_pitchControl = pitch;}
	void activateZipper(btScalar vel) {m_zipper_active = true; m_zipper_velocity = vel;}
	void deactivateZipper() {m_zipper_active = false;}
	void updateSuspension(btScalar deltaTime);
	virtual void updateFriction(btScalar timeStep);
};

#endif
